﻿@{
    Page.Title = "www.CambiaTuLibro.com";
    string user;
    string pass;
    
    
    var username = "";
    var password = "";

    if (IsPost) {
        // Extract the data from the form.
        username = Request.Form["username"];
        password = Request.Form["password"];

        // Attempt to login the user.
        WebSecurity.Login(username, password);
        
        <script>
            document.location.href = "Default.cshtml";
           // window.location.reload();
        //document.getElementById("demo").innerHTML="Hello World";
        </script>
    }
    
}


<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    
<title>@Page.Title </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--Estilos-->
<link href="css/style.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/style2.css" />
<link href="css/login.css" rel="stylesheet" type="text/css" />
    <link href="css/libros.css" rel="stylesheet" type="text/css" />
 <!--JavaScript-->
<script type="text/javascript" src="js/jquery.min.js"></script>
<!--<script type="text/javascript" src="Jquery/jquery-1.9.1.js"></script>
<!--<script type="text/javascript" src="Jquery/blockUI.v2.3.js"></script> -->
<script type="text/javascript" src="js/poup.js"></script>
</head>
<body>

    <!--Inicio de Login-->
    <div id="login-box" class="login-popup">
        <a href="#" class="close"><img src="imagenes/close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>
          <form method="post" class="signin" action="Default">
                <fieldset class="textbox">
            	<label class="username">
                <span>Username or email</span>
                <input id="username" name="username" value="" type="text" autocomplete="on" placeholder="Username">
                </label>
                
                <label class="password">
                <span>Password</span>
                <input id="password" name="password" value="" type="password" placeholder="Password">
                </label>
                <button class="submit button" type="sumit" >Sign in</button>
                
                <p>
                <a class="forgot" href="#">Forgot your password?</a>
                </p>
                
                </fieldset>
          </form>
		</div>
     <!-- fin login -->
    <form id="form1" runat="server">
<div id="container">
  <div id="menu">
    <ul>
      <li><a href="Default" class="current">Inicio</a></li>
      @if(WebSecurity.IsAuthenticated)
      {
      <li><a href="Biblioteca">Mi Biblioteca</a></li>
      }
      <li><a href="Libros">Libros</a></li>
      <li><a href="NuevosLibros">Nuevos Libros</a></li>
     <!-- <li><a href="http://www.free-css.com/">Compañia</a></li>-->
      <li><a href="Contacto">Contacto</a></li>
        @{
            
       // if (IsPost){ 
       if(WebSecurity.IsAuthenticated)
       {
       <li><a href="logout" class="" style ="float:right"  >Logout</a></li>
       <li><a href="#" class="" style ="float:right" >Bienvenido @WebSecurity.CurrentUserName</a></li>
      }
       else{
      <li><a href="Registro" style ="float:right"  >Registrarse</a></li>
      <li><a href="#login-box" class="login-window" style ="float:right" >Login</a></li>
       }
      // }
       }
    </ul>
   
  </div>
    
    
  <!-- end of menu -->
  <div id="header">
    <div id="special_offers">
      <p> <span>24/7</span> Intercambios a toda hora </p>
      <a href="Libros" style="margin-left: 50px;">Leer mas...</a> </div>
    <div id="new_books">
      <ul>
        <li>Cualquier categoria</li>
        <li>Intercambios</li>
        <li>Libros, tutoriales y mas!!</li>
      </ul>
      <a href="Libros" style="margin-left: 50px;">Leer mas...</a> </div>
  </div>
  <!-- end of header -->
  
  <div id="content">
    <div id="content_left">
    
      <div class="content_left_section">
           <Header><a href="Categorias"><h1>Categorias</h1></a></Header>
           <Header><a href="BestSeller"><h1>BestSellers</h1></a></Header>
                         
      </div>
      
    </div>
    <!-- end of content left -->

 @RenderBody()
    
    <div class="cleaner_with_height">&nbsp;</div>
  </div>
  <!-- end of content -->
  <div id="footer"> <a href="#">Home</a> | <a href="#">Search</a> | <a href="#">Books</a> | <a href="#">New Releases</a> | <a href="#">FAQs</a> | <a href="#">Contact Us</a><br />
    Copyright &copy; 2013 <a href="#"><strong>Innova TIC Corp</strong></a> | Designed by <a href="#">Innova TIC Corp.</a> </div>
  <!-- end of footer -->
</div>
<!-- end of container -->
    </form>
</body>
</html>
